package com.zyx.tl.transmittable.simpletl;

/**
 * <p>线程切换，ThreadLocal的数据会丢失</p>
 * @author Yaxi.Zhang
 * @since 2022/8/18 08:40
 */
public class CustomThreadLocal {
    static ThreadLocal<String> threadLocal = new ThreadLocal<>();
    public static void main(String[] args) {
        new Thread(() -> {
            CustomThreadLocal.threadLocal.set("zyx");
            new Service().call();
        }).start();
    }
}
